// Learn cc.Class:
//  - [Chinese] http://www.cocos.com/docs/creator/scripting/class.html
//  - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/class/index.html
// Learn Attribute:
//  - [Chinese] http://www.cocos.com/docs/creator/scripting/reference/attributes.html
//  - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/reference/attributes/index.html
// Learn life-cycle callbacks:
//  - [Chinese] http://www.cocos.com/docs/creator/scripting/life-cycle-callbacks.html
//  - [English] http://www.cocos2d-x.org/docs/editors_and_tools/creator-chapters/scripting/life-cycle-callbacks/index.html
var CMD = require("zjhCMD");
cc.Class({
    extends: cc.Component,

    properties: {
        className:"CMD",
    },


    // onLoad () {},

    start () {
    },
    ctor:function(){
        //创建房间 
        GameNet.netManager.pbAdapter.registerPBAdapter("req",CMD.UserCreateDeskReq,"UserCreateGodlDeskReq");
        //创建房间返回 
        GameNet.netManager.pbAdapter.registerPBAdapter("rsp",CMD.UserCreateDeskRsp,"UserCreateGoldDeskRsp");
        //玩家进入房间  请求
        GameNet.netManager.pbAdapter.registerPBAdapter("req",CMD.UserEnterDeskReq,"UserEnterDeskReq");
        //玩家进入房间  返回
        GameNet.netManager.pbAdapter.registerPBAdapter("rsp",CMD.UserEnterDeskNtf,"EvtGoldFlowerDeskUserEnter");
        //玩家准备  请求
        GameNet.netManager.pbAdapter.registerPBAdapter("req",CMD.UserReadyReq,"UserReadyReq");
        //服务器广播 玩家准备  返回
        GameNet.netManager.pbAdapter.registerPBAdapter("rsp",CMD.UserReadyNtf,"UserReadyNtf");
        
        //游戏开始
        GameNet.netManager.pbAdapter.registerPBAdapter("rsp",CMD.EvtGoldFlowerameStart,"EvtGoldFlowerameStart");

        //玩家请求看牌 客户端请求
        GameNet.netManager.pbAdapter.registerPBAdapter("req",CMD.GoldFlowerUserLookCardReq,"GoldFlowerUserLookCardReq");
        //玩家请求看牌 返回
        GameNet.netManager.pbAdapter.registerPBAdapter("rsp",CMD.GoldFlowerUserLookCardNtf,"GoldFlowerUserLookCardNtf");
        
        //玩家请求下注倍数 请求
        GameNet.netManager.pbAdapter.registerPBAdapter("req",CMD.GoldFlowerUserChipReq,"GoldFlowerUserChipReq");
        //玩家请求下注倍数 返回
        GameNet.netManager.pbAdapter.registerPBAdapter("rsp",CMD.GoldFlowerUserChipNtf,"GoldFlowerUserChipNtf");

        //玩家比牌 请求
        GameNet.netManager.pbAdapter.registerPBAdapter("req",CMD.GoldFlowerUserCompareReq,"GoldFlowerUserCompareReq");
        //玩家比牌  返回
        GameNet.netManager.pbAdapter.registerPBAdapter("rsp",CMD.GoldFlowerUserCompareNtf,"GoldFlowerUserCompareNtf");

        //玩家弃牌 请求
        GameNet.netManager.pbAdapter.registerPBAdapter("req",CMD.UserFoldReq,"GoldFlowerUserFoldReq");
        //玩家超时弃牌
        GameNet.netManager.pbAdapter.registerPBAdapter("rsp",CMD.GoldFlowerUserFlodNtf,"GoldFlowerUserFlodNtf");

        //超过最大积分  开始比牌消息
        GameNet.netManager.pbAdapter.registerPBAdapter("rsp",CMD.GoldFlowerRoundOverCompareCard,"GoldFlowerRoundOverCompareCard");
        //游戏结算
        GameNet.netManager.pbAdapter.registerPBAdapter("rsp",CMD.GoldFlowerGameOver,"GoldFlowerGameOver");
         //游戏大结算
        GameNet.netManager.pbAdapter.registerPBAdapter("rsp",CMD.FinalGameOver,"FinalGameOver");

        GameNet.netManager.pbAdapter.registerPBAdapter("rsp",CMD.BULL_FRIGHT_CLASSIC_EXIT_DESK,"EvtUserExit");

        GameNet.netManager.pbAdapter.registerPBAdapter("req",CMD.GetDeskInfoReq,"GetDeskInfoReq");

        GameNet.netManager.pbAdapter.registerPBAdapter("rsp",CMD.GetDeskInfoRsp,"GetDeskInfoRsp");

        GameNet.netManager.pbAdapter.registerPBAdapter("req",CMD.DeskChatReq,"DeskChatReq");

        GameNet.netManager.pbAdapter.registerPBAdapter("rsp",CMD.EvtDeskChat,"EvtDeskChat");
    },
    // update (dt) {},
});
